package rpd.mapper;

import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import rpd.model.TbCareer;
import rpd.model.TbCareerExample;
import rpd.model.TbCareerKey;
import rpd.model.TbCareerWithBLOBs;

public interface TbCareerMapper {
    long countByExample(TbCareerExample example);

    int deleteByExample(TbCareerExample example);

    @Delete({
        "delete from tb_career",
        "where id = #{id,jdbcType=CHAR}"
    })
    int deleteByPrimaryKey(TbCareerKey key);

    @Insert({
        "insert into tb_career (id, career_code, ",
        "industry_code, career_desc, ",
        "industry_desc)",
        "values (#{id,jdbcType=CHAR}, #{careerCode,jdbcType=INTEGER}, ",
        "#{industryCode,jdbcType=INTEGER}, #{careerDesc,jdbcType=LONGVARCHAR}, ",
        "#{industryDesc,jdbcType=LONGVARCHAR})"
    })
    int insert(TbCareerWithBLOBs record);

    int insertSelective(TbCareerWithBLOBs record);

    List<TbCareerWithBLOBs> selectByExampleWithBLOBs(TbCareerExample example);

    List<TbCareer> selectByExample(TbCareerExample example);

    @Select({
        "select",
        "id, career_code, industry_code, career_desc, industry_desc",
        "from tb_career",
        "where id = #{id,jdbcType=CHAR}"
    })
    @ResultMap("rpd.mapper.TbCareerMapper.ResultMapWithBLOBs")
    TbCareerWithBLOBs selectByPrimaryKey(TbCareerKey key);

    int updateByExampleSelective(@Param("record") TbCareerWithBLOBs record, @Param("example") TbCareerExample example);

    int updateByExampleWithBLOBs(@Param("record") TbCareerWithBLOBs record, @Param("example") TbCareerExample example);

    int updateByExample(@Param("record") TbCareer record, @Param("example") TbCareerExample example);

    int updateByPrimaryKeySelective(TbCareerWithBLOBs record);

    @Update({
        "update tb_career",
        "set career_code = #{careerCode,jdbcType=INTEGER},",
          "industry_code = #{industryCode,jdbcType=INTEGER},",
          "career_desc = #{careerDesc,jdbcType=LONGVARCHAR},",
          "industry_desc = #{industryDesc,jdbcType=LONGVARCHAR}",
        "where id = #{id,jdbcType=CHAR}"
    })
    int updateByPrimaryKeyWithBLOBs(TbCareerWithBLOBs record);

    @Update({
        "update tb_career",
        "set career_code = #{careerCode,jdbcType=INTEGER},",
          "industry_code = #{industryCode,jdbcType=INTEGER}",
        "where id = #{id,jdbcType=CHAR}"
    })
    int updateByPrimaryKey(TbCareer record);
}